package com.whacos.modules.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.whacos.modules.system.entity.SysTask;
import org.quartz.SchedulerException;

import java.util.List;

/**
 * @author xiongdun
 * @description SysJobService 系统任务
 * @since 2018/11/17 17:11
 */
//@Service
public interface SysTaskService extends IService<SysTask> {

    /**
     * 初始化定时任务
     * @throws SchedulerException
     */
    void initSchedule() throws SchedulerException;

    /**
     * 改变任务状态
     * @param jobId
     * @param cmd
     * @throws SchedulerException
     */
    void changeStatus(Long jobId, String cmd) throws SchedulerException;

    /**
     * 修改 cron
     * @param jobId
     * @param cron
     * @throws SchedulerException
     */
    void updateCron(Long jobId, String cron) throws SchedulerException;

    /**
     * 批量删除任务
     * @param idList
     * @return
     */
    boolean batchRemove(List<Long> idList);
}
